#-*-coding:utf-8 -*-

from NeuralNetwork import NeuralNetwork
import numpy as np

# #测试np.dot
# print(str(np.dot([1, 0],[4, 1])))
# print(str(np.dot([[1, 0], [0, 1]],[[4, 1], [2, 2]])))
# print
#
# #测试append
# a = [1,2,3] ;
# a.append([8,9])
# print(str(a))

# print np.random.randint(10)
#
# for k in range(10):
#     print k

# tmp = np.ones([3, 5])
# print( tmp )
# print
# print( tmp[:,0:-1] )

nn=NeuralNetwork([2,2,1],'tanh')
X=np.array([[0,0],[0,1],[1,0],[1,1]])
y=np.array([0,1,1,0])
nn.fit(X, y)

for i in [[0,0],[0,1],[1,0],[1,1]]:
    print(i,nn.predict(i))


